import java.util.Scanner;

class Palindrom {
    public static int numOfFoundPalindroms;
    public static void main(String [] args) {

        System.out.print("Vvedite stroku: ");
        Scanner sc = new Scanner(System.in);
        String s0;
        s0 = sc.nextLine();

        String s = s0.replaceAll(" ", "");


    }

    public static void findAllPalindroms(String s) {
        char chars[] = s.toCharArray();

        for(int firstChar = 0; firstChar<chars.length-1;firstChar++) {


            for(int secondChar = firstChar+1; secondChar<chars.length; secondChar++) {

                if((chars[firstChar] == chars[secondChar]) && ((secondChar-firstChar)>1)) {

                    String a = new String(chars, firstChar, secondChar-firstChar+1);

                    if (checkPalindrom(a)==true)
                        palindromIsFound(a);
                }
            }
        }
    }

    /**
     * Method for checking if current part of string is palindrom
     */
	public static boolean checkPalindrom(String b) {

        if (b.equals(reverseString(b))) {
            numOfFoundPalindroms +=1;
            return true;
        }
        else {
            return false;
        }
    }
	
	/**
     * Output finded palindrom
     */
    static void palindromIsFound(String b) {

        System.out.println("Palindrom " + numOfFoundPalindroms +": " + b);
    }
	
	/**
     * Changing current string to reverse
     */
    public static String reverseString(String c) {
        String d = new StringBuffer(c).reverse().toString();
        return d;
    }
}